<include file="Inc/header" />
<script type="text/javascript">
    function submitFun(act)
    {
        form1.action.value = act;
        form1.submit();
    }
</script>
<script>
    jQuery(function ($) {
        $("#btnPrint").click(function(){
            var phtml = $("#printArea").html();
           // alert(phtml);
            myPrint(phtml)
          //  $("#printArea").printArea();
        });

        $("#cxRuku").click(function(){
            var cxruku_id = $(this).data('id');
            login_all(cxruku_id);
        });
    });
    function myPrint(obj) {
            var newWindow = window.open("print.htm", "_blank"); //print.htm为同目录下的htm空页面
            newWindow.document.write(obj);
            newWindow.document.close();
            newWindow.print();
            newWindow.close();
    }

    function login_all(cxruku_id) {
        if(window.confirm('你确定要执行此项操作吗？')){
            //继续执行
         //   alert(cxruku_id);
            location.href = "/Admin/Kucun/cxruku/cxruku_id/"+cxruku_id;
        }
    }
</script>

        <!-- End .clear -->
        <div class="content-box">
            <!-- Start Content Box -->
            <div class="content-box-header">
                <form name='form1' action="{:U('Admin/Kucun/rukudan')}" method="get">
                    <include file="Inc/menu"/>
                    <div class="clear"></div>
                </form>
            </div>
            <!-- End .content-box-header -->
            <div class="content-box-content">
                <div class="tab-content default-tab" id="tab1">
                    <input id="btnPrint" type="button" value="点击打印"></input>
                    <input id="cxRuku" type="button" class="button1" data-id="{$cxruku_id}" value="撤销最后一次入库"></input>
                    <div id="printArea">
                        <style type="text/css">
                            table.gridtable {
                                font-family: verdana,arial,sans-serif;
                                font-size:11px;
                                color:#333333;
                                border-width: 1px;
                                border-color: #666666;
                                border-collapse: collapse;
                                width:98%;
                            }
                            table.gridtable th {
                                border-width: 1px;
                                padding: 8px;
                                border-style: solid;
                                border-color: #666666;
                                background-color: #dedede;
                            }
                            table.gridtable td {
                                border-width: 1px;
                                padding: 8px;
                                border-style: solid;
                                border-color: #666666;
                                background-color: #ffffff;
                            }
                            table.gridtable .title {
                                border-width: 0px;
                                padding: 18px;
                                border-style: solid;
                                border-color: #666666;
                                font-size: x-large;
                                background-color: #ffffff;
                            }
                            table.gridtable .ftitle {
                                border-width: 0px;
                                padding: 10px;
                                border-style: solid;
                                border-color: #666666;
                                background-color: #ffffff;
                            }
                        </style>
                        <volist name="stus" id="user">

                            <if condition="$user['check_title'] eq '1' ">
                                <table class="gridtable">
                                    <tr>
                                        <td colspan="6" style="text-align: center;" class="title">{$school_info.name}入库登记表</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" class="ftitle">日期:{$user['date']}</td>
                                        <td colspan="2" class="ftitle">收货人:{$user['shouhuoren']}</td>
                                        <td colspan="2" class="ftitle">单据号:{$user['danjuhao']}</td>
                                    </tr>
                                    <tr>
                                        <th width="10%">序号</th>
                                        <th width="40%">名称</th>
                                        <th width="10%">单价</th>
                                        <th width="10%">数量</th>
                                        <th width="10%">单位</th>
                                        <th width="20%">总价</th>
                                    </tr>
                            </if>

                            <if condition="$user['check_title'] eq '2' ">
                                <tr>
                                    <td colspan="5">{$user['name']}
                                    </td>
                                    <td>￥{$user['total']}</td>
                                </tr>
                                </table>
                                <div style="page-break-after:always;"></div><!--打印分页-->
                                <else />
                                <tr>
                                     <td>{$user['id']}</td>
                                     <td>{$user['name']}</td>
                                     <td>{$user['price']}</td>
                                     <td>{$user['number']}</td>
                                     <td>{$user['unit']}</td>
                                     <td>￥{$user['total']}</td>
                                 </tr>

                            </if>
                        </volist>
                    </div>
                </div>
                <!-- End #tab1 -->
            </div>
        </div>
        <include file="Inc/footer"/>